home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Complementary Applications 2004 February / SGI IRIX 6.5 Complementary Applications 2004 February.iso / dist / cde.idb / usr / dt / share / include / Xm / TextP.h.z / TextP.h
Encoding:
C/C++ Source or Header  |  2003-11-18  |  11.7 KB  |  300 lines

  1. /*
  2.  * TextP.h
  3.  *
  4.  * Copyright 2000, Silicon Graphics, Inc.
  5.  * ALL RIGHTS RESERVED
  6.  * 
  7.  * UNPUBLISHED -- Rights reserved under the copyright laws of the United
  8.  * States.   Use of a copyright notice is precautionary only and does not
  9.  * imply publication or disclosure.
  10.  *
  11.  * U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND:
  12.  * Use, duplication or disclosure by the Government is subject to restrictions
  13.  * as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights
  14.  * in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or
  15.  * in similar or successor clauses in the FAR, or the DOD or NASA FAR
  16.  * Supplement.  Contractor/manufacturer is Silicon Graphics, Inc.,
  17.  * 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311.
  18.  *
  19.  * THE CONTENT OF THIS WORK CONTAINS CONFIDENTIAL AND PROPRIETARY
  20.  * INFORMATION OF SILICON GRAPHICS, INC. ANY DUPLICATION, MODIFICATION,
  21.  * DISTRIBUTION, OR DISCLOSURE IN ANY FORM, IN WHOLE, OR IN PART, IS STRICTLY
  22.  * PROHIBITED WITHOUT THE PRIOR EXPRESS WRITTEN PERMISSION OF SILICON
  23.  * GRAPHICS, INC.
  24.  */
  25. /* 
  26.  * @OSF_COPYRIGHT@
  27.  * (c) Copyright 1990, 1991, 1992, 1993, 1994 OPEN SOFTWARE FOUNDATION, INC.
  28.  * ALL RIGHTS RESERVED
  29.  *  
  30. */ 
  31. /*
  32.  * HISTORY
  33.  * Motif Release 1.2.5
  34. */
  35. /*   $XConsortium: TextP.h /main/cde1_maint/2 1995/08/18 19:28:21 drk $ */
  36. /*
  37. *  (c) Copyright 1989, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
  38. /*
  39. *  (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 HEWLETT-PACKARD COMPANY */
  40. #ifndef _XmTextP_h
  41. #define _XmTextP_h
  42.  
  43. #include <Xm/PrimitiveP.h>
  44. #include <Xm/TextOutP.h>
  45. #include <Xm/TextInP.h>
  46.  
  47. typedef struct _InputRec *Input;
  48. typedef struct _OutputRec *Output;
  49.  
  50. #ifdef __cplusplus
  51. extern "C" {
  52. #endif
  53.  
  54. #define TEXTWIDGETCLASS    "Text"    /* Resource class for the text widget. */
  55.  
  56. #define GetSrc(widget)  (((XmTextWidget) (widget))->text.source)
  57.  
  58. #ifndef MIN
  59. #define MIN(x,y)    ((x) < (y) ? (x) : (y))
  60. #endif /* MIN */
  61.  
  62. typedef struct {
  63.     XtPointer        extension;    /* Pointer to extension record */
  64. } XmTextClassPart;
  65.  
  66. typedef struct _XmTextClassRec {
  67.     CoreClassPart core_class;
  68.     XmPrimitiveClassPart primitive_class;
  69.     XmTextClassPart text_class;
  70. } XmTextClassRec;
  71.  
  72. externalref XmTextClassRec    xmTextClassRec;
  73.  
  74. typedef struct {
  75.     XmTextPosition start;    /* First position in this line. */
  76.     Boolean changed;        /* TRUE if something in this line changed. */
  77.     XmTextPosition changed_position; /* First position within the line that
  78.                     has changed, if any. */
  79.     Boolean past_end;        /* TRUE if this line is past the end of any */
  80.                 /* line actually on the screen. */
  81.     LineTableExtra extra;    /* Extra info the output module keeps. */
  82. } LineRec, *Line;
  83.  
  84. typedef struct _XmTextLineTableRec{
  85.     unsigned int start_pos:31;
  86.     unsigned int virt_line:1;
  87. } XmTextLineTableRec, *XmTextLineTable;
  88.  
  89. typedef struct {
  90.     XmTextPosition from, to;    /* Information on one range to repaint. */
  91. } RangeRec;
  92.  
  93. typedef struct {
  94.     Cardinal number;        /* Number of ranges defined. */
  95.     Cardinal maximum;        /* Number of ranges we have space for. */
  96.     RangeRec *range;        /* Pointer to array of ranges. */
  97. } Ranges;
  98.  
  99.  
  100. /*
  101.  * Structure for main text info. 
  102.  */
  103.  
  104. typedef struct _XmTextPart {
  105.     XmTextSource source;           /* The source for this widget. */
  106.     XtCallbackList activate_callback;      /* command activate callback. */
  107.     XtCallbackList focus_callback;       /* Focus callback. */
  108.     XtCallbackList losing_focus_callback;  /* Losing focus callback. */
  109.     XtCallbackList value_changed_callback; /* Value changed callback. */
  110.     XtCallbackList modify_verify_callback; /* Verify value to change callback.*/
  111.     XtCallbackList wcs_modify_verify_callback; /* Verify value to change 
  112.                         * callback.*/
  113.     XtCallbackList motion_verify_callback; /* Insert cursor position 
  114.                           change callback. */
  115.     XtCallbackList gain_primary_callback; /* Gained ownership of Primary
  116.                          Selection */
  117.     XtCallbackList lose_primary_callback; /* Lost ownership of Primary
  118.                          Selection */
  119.     char *value;            /* The sring value in the widget */
  120.     wchar_t *wc_value;              /* Pointer for wchar_t value set by app */
  121.     Dimension margin_height;        /* height between text borders and text */
  122.     Dimension margin_width;         /* width between text borders and text */
  123.     Position cursor_position_x;     /* x pixel location of cursor */
  124.     OutputCreateProc output_create; /* Routine to create the output portion. */
  125.     InputCreateProc input_create;   /* Routine to create the input portion. */
  126.     /* The naming incongruity amongst the next three items was introduced */
  127.     /* due to a collision with top_position as used as a Form constraint; */
  128.     /* It has no other implications. */
  129.     XmTextPosition top_character;    /* First position to display. */
  130.     XmTextPosition bottom_position; /* Last position to display. */
  131.     XmTextPosition cursor_position; /* Location of the insertion point. */
  132.     int max_length;            /* Sets the max. length of string */
  133.     int edit_mode;            /* Sets the line editing mode
  134.                        (i.e. sinlge_line, multi_line, ...) */
  135.     Boolean auto_show_cursor_position; /* If true, automatically try to show
  136.                       the cursor position whenever it
  137.                       changes. */
  138.     Boolean editable;          /* Determines if text is editable */
  139.     Boolean verify_bell;       /* Determines if bell is sounded when verify
  140.                    *  callback returns doit - False
  141.                                    */
  142.     Boolean add_mode;          /* Determines the state of add moder */
  143.     Boolean traversed;            /* Flag used with losing focus verification to
  144.                      indicate a traversal key pressed event */
  145.     Boolean in_redisplay;      /* Whether currently in the redisplay proc. */
  146.     Boolean needs_redisplay;      /* Whether we need to repaint or refigure. */
  147.     Boolean in_refigure_lines;      /* Whether currently in refigurelines proc. */
  148.     Boolean needs_refigure_lines; /* Whether we need to refigure. */
  149.     Boolean in_setvalues;         /* Use to reduce unnecessary redisplays and
  150.                      geometry requsets */
  151.     Boolean in_resize;          /* Make sure there are no geometry requests
  152.                      while we are in resize procedure. */
  153.     Boolean in_expose;          /* Make sure there are no geometry requests
  154.                      while we are in expose procedure. */
  155.     Boolean highlight_changed;      /* Whether highlighting recently changed. */
  156.     Boolean pendingoff;         /* TRUE if we shouldn't do pending delete on
  157.                                    the current selection. */
  158.     char char_size;             /* number of bytes for storing a character */
  159.  
  160.     OnOrOff on_or_off;          /* used to halt unecessary motion verify
  161.                      callback calls during primary moves.*/
  162.     Output output;           /* The output portion. */
  163.     Input input;           /* The input portion. */
  164.  
  165.     XmTextPosition first_position; /* First legal position in the source. */
  166.     XmTextPosition last_position;  /* Last legal position in the source. */
  167.     XmTextPosition forget_past;       /* Forget all about positions past this. */
  168.     XmTextPosition force_display;  /* Force this position to be displayed. */
  169.     XmTextPosition new_top;       /* Desired new top position. */
  170.     XmTextPosition last_top_char;  /* unused - available. */
  171.     XmTextPosition dest_position;  /* Location of the destination point. */
  172.     int disable_depth;           /* How many levels of disable we've done. */
  173.  
  174.     int pending_scroll;        /* Number of lines we want to scroll. */
  175.     int total_lines;        /* Total number of lines in the text widget */
  176.     int top_line;        /* Line number of the top visible line */
  177.     int vsbar_scrolling;    /* scrolling using the vertical scrollbar */
  178.  
  179.     Cardinal number_lines;    /* Number of line table entries. */
  180.     Cardinal maximum_lines;    /* Maximum number of line table entries. */
  181.     Line line;            /* Pointer to array of line table entries. */
  182.  
  183.     Ranges repaint;        /* Info on the repaint ranges. */
  184.     _XmHighlightData highlight;    /* Info on the highlighting regions. */
  185.     _XmHighlightData old_highlight;/* Old value of above. */
  186.     Widget inner_widget;    /* Pointer to widget which actually contains
  187.                    text (may be same or different from
  188.                    this record).  */
  189.     XmTextLineTable line_table;
  190.     unsigned int table_size;
  191.     unsigned int table_index;
  192. } XmTextPart;
  193.  
  194. typedef struct _XmTextRec {
  195.     CorePart    core;
  196.     XmPrimitivePart primitive;
  197.     XmTextPart text;
  198. } XmTextRec;
  199.  
  200.  
  201. /********    Private Function Declarations    ********/
  202. #ifdef _NO_PROTO
  203.  
  204. extern XmTextPosition _XmTextFindScroll() ;
  205. extern int _XmTextGetTotalLines() ;
  206. extern XmTextLineTable _XmTextGetLineTable() ;
  207. extern void _XmTextRealignLineTable() ;
  208. extern unsigned int _XmTextGetTableIndex() ;
  209. extern void _XmTextUpdateLineTable() ;
  210. extern void _XmTextMarkRedraw() ;
  211. extern LineNum _XmTextNumLines() ;
  212. extern void _XmTextLineInfo() ;
  213. extern LineNum _XmTextPosToLine() ;
  214. extern void _XmTextInvalidate() ;
  215. extern void _XmTextSetTopCharacter() ;
  216. extern int _XmTextCountCharacters() ;
  217. extern void _XmTextSetCursorPosition() ;
  218. extern void _XmTextDisableRedisplay() ;
  219. extern void _XmTextEnableRedisplay() ;
  220.  
  221. #else
  222.  
  223. extern XmTextPosition _XmTextFindScroll( 
  224.                         XmTextWidget widget,
  225.                         XmTextPosition start,
  226.                         int delta) ;
  227. extern int _XmTextGetTotalLines( 
  228.                         Widget widget) ;
  229. extern XmTextLineTable _XmTextGetLineTable( 
  230.                         Widget widget,
  231.                         int *total_lines) ;
  232. extern void _XmTextRealignLineTable( 
  233.                         XmTextWidget widget,
  234.                         XmTextLineTable *temp_table,
  235.                         int *temp_table_size,
  236.                         register unsigned int cur_index,
  237.                         register XmTextPosition cur_start,
  238.                         register XmTextPosition cur_end) ;
  239. extern unsigned int _XmTextGetTableIndex(
  240.             XmTextWidget widget,
  241.             XmTextPosition pos) ;
  242. extern void _XmTextUpdateLineTable( 
  243.                         Widget widget,
  244.                         XmTextPosition start,
  245.                         XmTextPosition end,
  246.                         XmTextBlock block,
  247. #if NeedWidePrototypes
  248.                         int update) ;
  249. #else
  250.                         Boolean update) ;
  251. #endif /* NeedWidePrototypes */
  252. extern void _XmTextMarkRedraw( 
  253.                         XmTextWidget widget,
  254.                         XmTextPosition left,
  255.                         XmTextPosition right) ;
  256. extern LineNum _XmTextNumLines( 
  257.                         XmTextWidget widget) ;
  258. extern void _XmTextLineInfo( 
  259.                         XmTextWidget widget,
  260.                         LineNum line,
  261.                         XmTextPosition *startpos,
  262.                         LineTableExtra *extra) ;
  263. extern LineNum _XmTextPosToLine( 
  264.                         XmTextWidget widget,
  265.                         XmTextPosition position) ;
  266. extern void _XmTextInvalidate( 
  267.                         XmTextWidget widget,
  268.                         XmTextPosition position,
  269.                         XmTextPosition topos,
  270.                         long delta) ;
  271. extern void _XmTextSetTopCharacter(
  272.                       Widget widget,
  273.                       XmTextPosition top_character) ;
  274. extern int _XmTextCountCharacters( 
  275.                         char *str,
  276.                         int num_count_bytes) ;
  277. extern void _XmTextSetCursorPosition( 
  278.                         Widget widget,
  279.                         XmTextPosition position) ;
  280. extern void _XmTextDisableRedisplay( 
  281.                         XmTextWidget widget,
  282. #if NeedWidePrototypes
  283.                         int losesbackingstore) ;
  284. #else
  285.                         Boolean losesbackingstore) ;
  286. #endif /* NeedWidePrototypes */
  287. extern void _XmTextEnableRedisplay( 
  288.                         XmTextWidget widget) ;
  289.  
  290. #endif /* _NO_PROTO */
  291. /********    End Private Function Declarations    ********/
  292.  
  293.  
  294. #ifdef __cplusplus
  295. }  /* Close scope of 'extern "C"' declaration which encloses file. */
  296. #endif
  297.  
  298. #endif /* _XmTextP_h */
  299. /* DON't ADD STUFF AFTER THIS #endif */
  300.